import { mapState, mapActions } from 'vuex'
// import { Toast } from 'vant'
export default {
  data() {
    return {
      firstLoading: false // 初始化加载了
    }
  },
  computed: mapState({
    screenLoading: state => state.screenLoading, // 全局加载框状态
    userInfo: state => state.user.userInfo, // 用户所有信息
    userSig: state => state.userSig // 用户签名
  }),
  created() {
    this.firstLoading = true
    console.log(this)
  },
  methods: {
    ...mapActions(['getUser', 'login', 'logout'])
  },
  beforeDestroy() {
    // 退出登录
    this.logout()
  }
}
